class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: A = None
        self.r: F = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

g = A("g")
d = B("d")
j = C("j")
k = D("k")
m = E("m")
c = F("c")
b = D("b")
l = C("l")
a = F("a")

g.x = b
d.t = m
j.q = l
j.x = g
j.z = g
j.r = c
k.p = m
k.v = g
k.x = g
k.w = d
m.v = c
c.s = a
c.z = a
c.u = k
b.p = m
b.v = g
b.x = g
b.w = d
l.q = j
l.x = g
l.z = g
l.r = a
a.s = c
a.z = c
a.u = k
assert j.z.x.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: A = None
        self.r: F = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

g = A("g")
d = B("d")
j = C("j")
k = D("k")
m = E("m")
c = F("c")
b = D("b")
l = C("l")
a = F("a")

g.x = b
d.t = m
j.q = l
j.x = g
j.z = g
j.r = c
k.p = m
k.v = g
k.x = g
k.w = d
m.v = c
c.s = a
c.z = a
c.u = k
b.p = m
b.v = g
b.x = g
b.w = d
l.q = j
l.x = g
l.z = g
l.r = a
a.s = c
a.z = c
a.u = k
assert j.z.x.v.x.txt == "b"