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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.u: E = None
        self.x: C = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: B = None
        self.u: A = None
        self.o: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.u: E = None
        self.x: C = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: B = None
        self.u: A = None
        self.o: C = None
        self.txt = txt

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

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