class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: E = None
        self.p: D = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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