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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.v: C = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

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

h.p = j
b.w = c
b.o = f
b.r = f
l.t = j
l.w = f
j.p = f
f.w = j
f.r = b
f.s = b
f.v = l
f.q = l
e.q = l
e.v = j
e.s = f
e.w = b
k.q = l
k.v = j
k.s = f
k.w = b
n.w = c
n.o = f
n.r = f
c.q = l
c.v = j
c.s = f
c.w = n
assert e.v.p.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: E = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: B = None
        self.v: C = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

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

h.p = j
b.w = c
b.o = f
b.r = f
l.t = j
l.w = f
j.p = f
f.w = j
f.r = b
f.s = b
f.v = l
f.q = l
e.q = l
e.v = j
e.s = f
e.w = b
k.q = l
k.v = j
k.s = f
k.w = b
n.w = c
n.o = f
n.r = f
c.q = l
c.v = j
c.s = f
c.w = n
assert e.v.p.v.t.txt == "j"