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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: C = None
        self.r: C = None
        self.p: C = None
        self.txt = txt

f = A("f")
c = B("c")
n = C("n")
b = D("b")
m = E("m")
h = F("h")

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: C = None
        self.r: C = None
        self.p: C = None
        self.txt = txt

f = A("f")
c = B("c")
n = C("n")
b = D("b")
m = E("m")
h = F("h")

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