class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: D = None
        self.r: B = None
        self.p: D = None
        self.t: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

l.w = b
l.s = b
l.y = j
l.p = j
l.r = h
l.t = d
c.r = h
c.u = k
c.x = l
k.v = h
j.y = b
j.w = b
j.r = l
n.r = j
n.w = j
b.w = n
d.r = h
d.u = k
d.x = l
e.r = d
e.u = k
e.x = l
h.r = c
h.u = k
h.x = l
assert d.r.r.u.v.u.v.x.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: D = None
        self.r: B = None
        self.p: D = None
        self.t: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

l.w = b
l.s = b
l.y = j
l.p = j
l.r = h
l.t = d
c.r = h
c.u = k
c.x = l
k.v = h
j.y = b
j.w = b
j.r = l
n.r = j
n.w = j
b.w = n
d.r = h
d.u = k
d.x = l
e.r = d
e.u = k
e.x = l
h.r = c
h.u = k
h.x = l
assert d.r.r.u.v.u.v.x.r.r.txt == "c"