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

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

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

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

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

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

j = A("j")
c = B("c")
m = C("m")
a = D("a")
f = E("f")
d = F("d")
l = B("l")
k = D("k")
n = F("n")

j.t = c
c.x = k
c.u = k
m.x = a
m.w = f
m.v = j
m.t = n
a.t = m
a.r = m
a.p = d
a.y = c
f.y = k
f.q = a
d.w = j
d.q = m
d.r = n
l.x = k
l.u = k
k.t = m
k.r = m
k.p = n
k.y = l
n.w = j
n.q = m
n.r = d
assert l.u.r.x.y.x.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

j = A("j")
c = B("c")
m = C("m")
a = D("a")
f = E("f")
d = F("d")
l = B("l")
k = D("k")
n = F("n")

j.t = c
c.x = k
c.u = k
m.x = a
m.w = f
m.v = j
m.t = n
a.t = m
a.r = m
a.p = d
a.y = c
f.y = k
f.q = a
d.w = j
d.q = m
d.r = n
l.x = k
l.u = k
k.t = m
k.r = m
k.p = n
k.y = l
n.w = j
n.q = m
n.r = d
assert l.u.r.x.y.x.t.w.txt == "f"