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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: B = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: B = None
        self.y: F = None
        self.q: D = None
        self.txt = txt

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

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

i = A("i")
c = B("c")
e = C("e")
g = D("g")
f = E("f")
h = F("h")
m = D("m")
d = A("d")

i.t = c
i.r = e
i.y = d
i.v = d
i.x = f
c.p = e
e.w = h
e.r = c
e.z = g
g.v = f
g.w = c
g.y = h
g.q = m
f.r = d
h.x = e
m.v = f
m.w = c
m.y = h
m.q = g
d.t = c
d.r = e
d.y = i
d.v = i
d.x = f
assert i.x.r.t.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.y: A = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: B = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: B = None
        self.y: F = None
        self.q: D = None
        self.txt = txt

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

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

i = A("i")
c = B("c")
e = C("e")
g = D("g")
f = E("f")
h = F("h")
m = D("m")
d = A("d")

i.t = c
i.r = e
i.y = d
i.v = d
i.x = f
c.p = e
e.w = h
e.r = c
e.z = g
g.v = f
g.w = c
g.y = h
g.q = m
f.r = d
h.x = e
m.v = f
m.w = c
m.y = h
m.q = g
d.t = c
d.r = e
d.y = i
d.v = i
d.x = f
assert i.x.r.t.p.r.txt == "c"