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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

f = A("f")
h = B("h")
i = C("i")
k = D("k")
n = E("n")
c = F("c")
l = B("l")
j = B("j")

f.t = n
f.r = i
f.p = i
f.s = k
h.u = n
h.y = n
h.z = k
h.p = c
i.y = c
k.r = f
n.y = i
n.z = l
n.t = k
n.w = k
n.q = f
c.v = f
c.u = f
c.w = n
c.r = k
l.u = n
l.y = n
l.z = k
l.p = c
j.u = n
j.y = n
j.z = k
j.p = c
assert h.z.r.s.r.t.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: C = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: A = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

f = A("f")
h = B("h")
i = C("i")
k = D("k")
n = E("n")
c = F("c")
l = B("l")
j = B("j")

f.t = n
f.r = i
f.p = i
f.s = k
h.u = n
h.y = n
h.z = k
h.p = c
i.y = c
k.r = f
n.y = i
n.z = l
n.t = k
n.w = k
n.q = f
c.v = f
c.u = f
c.w = n
c.r = k
l.u = n
l.y = n
l.z = k
l.p = c
j.u = n
j.y = n
j.z = k
j.p = c
assert h.z.r.s.r.t.q.s.txt == "k"