class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.w: E = None
        self.y: A = None
        self.u: E = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: C = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.u: G = None
        self.o: G = None
        self.z: G = None
        self.t: B = None
        self.txt = txt

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

f = A("f")
b = B("b")
d = C("d")
k = D("k")
c = E("c")
m = F("m")
n = G("n")

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.w: E = None
        self.y: A = None
        self.u: E = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: C = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.u: G = None
        self.o: G = None
        self.z: G = None
        self.t: B = None
        self.txt = txt

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

f = A("f")
b = B("b")
d = C("d")
k = D("k")
c = E("c")
m = F("m")
n = G("n")

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