class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: E = None
        self.q: F = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: G = None
        self.x: B = None
        self.w: B = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.z: C = None
        self.t: E = None
        self.s: C = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

m = A("m")
k = B("k")
d = C("d")
l = D("l")
a = E("a")
i = F("i")
c = G("c")
j = B("j")
f = D("f")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: E = None
        self.q: F = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: G = None
        self.x: B = None
        self.w: B = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.z: C = None
        self.t: E = None
        self.s: C = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

m = A("m")
k = B("k")
d = C("d")
l = D("l")
a = E("a")
i = F("i")
c = G("c")
j = B("j")
f = D("f")

m.p = f
m.o = j
m.r = a
k.p = i
k.q = i
k.t = a
k.s = j
k.u = d
d.r = c
d.v = l
d.w = l
l.z = c
l.q = c
l.x = k
l.w = k
l.s = i
a.u = i
i.r = k
c.r = m
c.y = m
c.z = d
c.s = d
c.t = a
c.x = k
c.q = i
j.p = i
j.q = i
j.t = a
j.s = k
j.u = d
f.z = c
f.q = c
f.x = j
f.w = j
f.s = i
assert a.u.r.s.t.txt == "a"