class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.v: F = None
        self.z: E = None
        self.s: B = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: E = None
        self.z: C = None
        self.p: A = None
        self.txt = txt

l = A("l")
j = B("j")
d = C("d")
b = D("b")
e = E("e")
g = F("g")
n = B("n")
h = E("h")
a = D("a")
f = D("f")

l.y = h
j.o = e
j.z = e
j.q = g
j.v = g
j.p = g
j.s = n
d.t = n
d.x = l
d.u = l
d.v = a
b.u = g
e.w = d
e.x = d
g.y = d
g.z = d
g.t = h
g.p = l
n.o = h
n.z = h
n.q = g
n.v = g
n.p = g
n.s = j
h.w = d
h.x = d
a.u = g
f.u = g
assert j.z.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.v: F = None
        self.z: E = None
        self.s: B = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: E = None
        self.z: C = None
        self.p: A = None
        self.txt = txt

l = A("l")
j = B("j")
d = C("d")
b = D("b")
e = E("e")
g = F("g")
n = B("n")
h = E("h")
a = D("a")
f = D("f")

l.y = h
j.o = e
j.z = e
j.q = g
j.v = g
j.p = g
j.s = n
d.t = n
d.x = l
d.u = l
d.v = a
b.u = g
e.w = d
e.x = d
g.y = d
g.z = d
g.t = h
g.p = l
n.o = h
n.z = h
n.q = g
n.v = g
n.p = g
n.s = j
h.w = d
h.x = d
a.u = g
f.u = g
assert j.z.x.v.txt == "a"