class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: C = None
        self.z: F = None
        self.t: F = None
        self.v: A = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.z: A = None
        self.r: B = None
        self.v: B = None
        self.u: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: C = None
        self.txt = txt

m = A("m")
g = B("g")
n = C("n")
d = D("d")
a = E("a")
f = F("f")
l = G("l")
j = A("j")

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.z: A = None
        self.r: B = None
        self.v: B = None
        self.u: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: C = None
        self.txt = txt

m = A("m")
g = B("g")
n = C("n")
d = D("d")
a = E("a")
f = F("f")
l = G("l")
j = A("j")

m.w = d
m.y = n
m.z = f
m.t = f
m.r = f
m.v = j
g.t = n
g.z = n
n.s = f
n.t = a
n.z = j
n.r = g
n.v = g
n.u = m
d.t = a
d.z = a
d.x = n
d.p = f
a.w = d
f.w = j
f.y = n
l.q = n
l.r = n
j.w = d
j.y = n
j.z = f
j.t = f
j.r = f
j.v = m
assert f.w.y.z.txt == "j"