class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: F = None
        self.v: F = None
        self.o: A = None
        self.x: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: G = None
        self.o: F = None
        self.w: B = None
        self.r: G = None
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: F = None
        self.v: F = None
        self.o: A = None
        self.x: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: G = None
        self.o: F = None
        self.w: B = None
        self.r: G = None
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: D = None
        self.x: G = None
        self.txt = txt

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

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

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