class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.r: A = None
        self.s: A = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: B = None
        self.y: E = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: D = None
        self.r: A = None
        self.p: D = None
        self.v: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: B = None
        self.y: E = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: D = None
        self.r: A = None
        self.p: D = None
        self.v: C = None
        self.txt = txt

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

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

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