class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: G = None
        self.t: G = None
        self.y: B = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: G = None
        self.y: C = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: G = None
        self.y: C = None
        self.o: G = None
        self.txt = txt

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

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

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