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

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

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

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

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

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

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

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

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

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

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

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

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

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

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