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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: B = None
        self.p: B = None
        self.x: E = None
        self.y: C = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
e = C("e")
j = D("j")
i = E("i")
h = F("h")
n = F("n")

b.p = j
b.q = j
b.r = i
l.w = b
l.v = h
l.r = j
e.p = l
e.u = b
e.v = j
j.s = l
j.o = l
j.p = l
j.x = i
j.y = e
i.o = n
i.q = h
i.x = e
h.y = j
h.v = j
h.o = b
h.u = i
n.y = j
n.v = j
n.o = b
n.u = i
assert b.r.q.v.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.r: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: B = None
        self.p: B = None
        self.x: E = None
        self.y: C = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
e = C("e")
j = D("j")
i = E("i")
h = F("h")
n = F("n")

b.p = j
b.q = j
b.r = i
l.w = b
l.v = h
l.r = j
e.p = l
e.u = b
e.v = j
j.s = l
j.o = l
j.p = l
j.x = i
j.y = e
i.o = n
i.q = h
i.x = e
h.y = j
h.v = j
h.o = b
h.u = i
n.y = j
n.v = j
n.o = b
n.u = i
assert b.r.q.v.y.u.txt == "b"