class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: F = None
        self.u: D = None
        self.r: F = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.w: C = None
        self.v: C = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.w: C = None
        self.v: C = None
        self.q: D = None
        self.y: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: F = None
        self.q: D = None
        self.txt = txt

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

j.w = m
j.s = e
j.r = e
j.q = e
j.u = d
m.z = j
m.q = d
m.y = f
m.p = l
m.r = e
a.p = m
a.u = m
a.y = m
a.w = f
a.v = f
a.q = d
d.y = a
d.w = a
d.o = f
l.x = n
l.s = n
e.x = a
b.v = d
b.q = d
b.w = e
c.v = d
c.q = d
c.w = e
f.p = m
f.u = m
f.y = m
f.w = a
f.v = a
f.q = d
n.x = l
n.s = l
assert j.s.x.q.txt == "d"