class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: E = None
        self.o: G = None
        self.w: D = None
        self.t: B = None
        self.q: B = None
        self.x: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: F = None
        self.o: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: F = None
        self.o: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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